/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bs.Beans;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Bone
 */
@Entity
@Table(name = "dav_cabecalho")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "DavCabecalho.findAll", query = "SELECT d FROM DavCabecalho d")})
public class DavCabecalho implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(nullable = false)
    private Integer id;
    @Column(name = "NUMERO_DAV", length = 10)
    private String numeroDav;
    @Column(name = "NUMERO_ECF", length = 4)
    private String numeroEcf;
    private Integer ccf;
    private Integer coo;
    @Column(name = "NOME_DESTINATARIO", length = 100)
    private String nomeDestinatario;
    @Column(name = "CPF_CNPJ_DESTINATARIO", length = 14)
    private String cpfCnpjDestinatario;
    @Column(name = "DATA_EMISSAO")
    @Temporal(TemporalType.DATE)
    private Date dataEmissao;
    @Column(name = "HORA_EMISSAO", length = 8)
    private String horaEmissao;
    private Character situacao;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "TAXA_ACRESCIMO", precision = 18, scale = 6)
    private BigDecimal taxaAcrescimo;
    @Column(precision = 18, scale = 6)
    private BigDecimal acrescimo;
    @Column(name = "TAXA_DESCONTO", precision = 18, scale = 6)
    private BigDecimal taxaDesconto;
    @Column(precision = 18, scale = 6)
    private BigDecimal desconto;
    @Column(precision = 18, scale = 6)
    private BigDecimal subtotal;
    @Column(precision = 18, scale = 6)
    private BigDecimal valor;
    private Character impresso;
    @Column(name = "HASH_TRIPA", length = 32)
    private String hashTripa;
    @Column(name = "HASH_INCREMENTO")
    private Integer hashIncremento;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idDavCabecalho")
    private List<DavDetalhe> davDetalheList;
    @JoinColumn(name = "ID_EMPRESA", referencedColumnName = "ID", nullable = false)
    @ManyToOne(optional = false)
    private Empresa idEmpresa;
    @JoinColumn(name = "ID_PESSOA", referencedColumnName = "ID", nullable = false)
    @ManyToOne(optional = false)
    private Pessoa idPessoa;

    public DavCabecalho() {
    }

    public DavCabecalho(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getNumeroDav() {
        return numeroDav;
    }

    public void setNumeroDav(String numeroDav) {
        this.numeroDav = numeroDav;
    }

    public String getNumeroEcf() {
        return numeroEcf;
    }

    public void setNumeroEcf(String numeroEcf) {
        this.numeroEcf = numeroEcf;
    }

    public Integer getCcf() {
        return ccf;
    }

    public void setCcf(Integer ccf) {
        this.ccf = ccf;
    }

    public Integer getCoo() {
        return coo;
    }

    public void setCoo(Integer coo) {
        this.coo = coo;
    }

    public String getNomeDestinatario() {
        return nomeDestinatario;
    }

    public void setNomeDestinatario(String nomeDestinatario) {
        this.nomeDestinatario = nomeDestinatario;
    }

    public String getCpfCnpjDestinatario() {
        return cpfCnpjDestinatario;
    }

    public void setCpfCnpjDestinatario(String cpfCnpjDestinatario) {
        this.cpfCnpjDestinatario = cpfCnpjDestinatario;
    }

    public Date getDataEmissao() {
        return dataEmissao;
    }

    public void setDataEmissao(Date dataEmissao) {
        this.dataEmissao = dataEmissao;
    }

    public String getHoraEmissao() {
        return horaEmissao;
    }

    public void setHoraEmissao(String horaEmissao) {
        this.horaEmissao = horaEmissao;
    }

    public Character getSituacao() {
        return situacao;
    }

    public void setSituacao(Character situacao) {
        this.situacao = situacao;
    }

    public BigDecimal getTaxaAcrescimo() {
        return taxaAcrescimo;
    }

    public void setTaxaAcrescimo(BigDecimal taxaAcrescimo) {
        this.taxaAcrescimo = taxaAcrescimo;
    }

    public BigDecimal getAcrescimo() {
        return acrescimo;
    }

    public void setAcrescimo(BigDecimal acrescimo) {
        this.acrescimo = acrescimo;
    }

    public BigDecimal getTaxaDesconto() {
        return taxaDesconto;
    }

    public void setTaxaDesconto(BigDecimal taxaDesconto) {
        this.taxaDesconto = taxaDesconto;
    }

    public BigDecimal getDesconto() {
        return desconto;
    }

    public void setDesconto(BigDecimal desconto) {
        this.desconto = desconto;
    }

    public BigDecimal getSubtotal() {
        return subtotal;
    }

    public void setSubtotal(BigDecimal subtotal) {
        this.subtotal = subtotal;
    }

    public BigDecimal getValor() {
        return valor;
    }

    public void setValor(BigDecimal valor) {
        this.valor = valor;
    }

    public Character getImpresso() {
        return impresso;
    }

    public void setImpresso(Character impresso) {
        this.impresso = impresso;
    }

    public String getHashTripa() {
        return hashTripa;
    }

    public void setHashTripa(String hashTripa) {
        this.hashTripa = hashTripa;
    }

    public Integer getHashIncremento() {
        return hashIncremento;
    }

    public void setHashIncremento(Integer hashIncremento) {
        this.hashIncremento = hashIncremento;
    }

    @XmlTransient
    public List<DavDetalhe> getDavDetalheList() {
        return davDetalheList;
    }

    public void setDavDetalheList(List<DavDetalhe> davDetalheList) {
        this.davDetalheList = davDetalheList;
    }

    public Empresa getIdEmpresa() {
        return idEmpresa;
    }

    public void setIdEmpresa(Empresa idEmpresa) {
        this.idEmpresa = idEmpresa;
    }

    public Pessoa getIdPessoa() {
        return idPessoa;
    }

    public void setIdPessoa(Pessoa idPessoa) {
        this.idPessoa = idPessoa;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof DavCabecalho)) {
            return false;
        }
        DavCabecalho other = (DavCabecalho) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.bs.Beans.DavCabecalho[ id=" + id + " ]";
    }
    
}
